class Palendrome
{
    char *name;
    int length;
  public:
    Palendrome(char *s)
    {
    name=s;length=strlen(s);
    }
    int checkPalendrome();
};
int Palendrome::checkPalendrome()
{
  int l,flag=0;//=length/2,flag=0;
  if(length%2==0)
    l=length/2-1;
  else
    l=length/2;
  for(int i=1;i<=l;i++)
    if(name[i-1]!=name[length-i])
    {  flag=1;break; }
  if(flag==0)
    return 1;
  else
    return 0;
}
int main()
{
  Palendrome obj("madam");
  clrscr();
  if(obj.checkPalendrome())
    cout<<"\n Given string is Palendrome ";
  else
    cout<<"\n Given string is not a Palendrome ";
  getch();return 0;
}
